home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Cafe 3
/
Visual Cafe 3.ISO
/
Vcafe
/
Main.bin
/
BooleanArrayOption.java
< prev
next >
Wrap
Text File
|
1998-09-08
|
2KB
|
94 lines
package com.symantec.itools.frameworks.application.commandline;
/**
* BooleanArrayOption is an abstract base class for all boolean
* array command line arguments.
* @author Symantec Internet Tools Division
* @version 1.0
* @since VCafe 3.0
*/
public abstract class BooleanArrayOption
extends ArrayOption
{
public BooleanArrayOption()
{
}
public BooleanArrayOption(String[] flags)
{
super(flags);
}
public BooleanArrayOption(String[] flags, int count)
{
super(flags, count);
}
/**
* @param args TODO
* @param startIndex TODO
* @exception com.symantec.itools.frameworks.application.commandline.MissingArgumentsException
* @since VCafe 3.0
*/
/*
args[ start_index ] will be the flag.
args[ start_index + 1 ] should be the first integer value
*/
protected boolean[] getBooleanArray(String[] args, int startIndex)
throws MissingArgumentsException
{
boolean[] array;
array = new boolean[count];
try
{
for(int i = 0; i < count; i++)
{
array[i] = Boolean.valueOf(args[startIndex + i + 1]).booleanValue();
}
}
catch(ArrayIndexOutOfBoundsException ex)
{
throw new MissingArgumentsException(args[startIndex]);
}
return (array);
}
/**
* @param args TODO
* @param startIndex TODO
* @param count TODO
* @exception com.symantec.itools.frameworks.application.commandline.MissingArgumentsException
* @since VCafe 3.0
*/
/*
args[ start_index ] will be the flag.
args[ start_index + 1 ] should be the first integer value
*/
protected boolean[] getBooleanArray(String[] args, int startIndex, int count)
throws MissingArgumentsException
{
boolean[] array;
this.count = count;
array = new boolean[count];
try
{
for(int i = 0; i < count; i++)
{
array[i] = Boolean.valueOf(args[startIndex + i + 1]).booleanValue();
}
}
catch(ArrayIndexOutOfBoundsException ex)
{
throw new MissingArgumentsException(args[startIndex]);
}
return (array);
}
}